<template>
  <div class="admin-container">
    <el-container>
      <el-aside width="200px">
        <el-menu
          :default-active="activeMenu"
          class="admin-menu"
          @select="handleMenuSelect"
        >
          <el-menu-item index="attraction">
            <i class="el-icon-location"></i>
            <span>景点管理</span>
          </el-menu-item>
          <el-menu-item index="user">
            <i class="el-icon-user"></i>
            <span>用户管理</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    return {
      activeMenu: 'attraction'
    }
  },
  methods: {
    handleMenuSelect(index) {
      this.$router.push(`/pages/admin/${index}`);
    }
  }
}
</script>

<style scoped>
.admin-container {
  height: 100vh;
}
.admin-menu {
  height: 100%;
}
</style>